home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / boostrs.arc / NSORBIT.PAS < prev    next >
Pascal/Delphi Source File  |  1985-11-03  |  2KB  |  74 lines

  1. { --------------------------------
  2.   NSORBIT - Nancy's Orbiting Light
  3.   -------------------------------- }
  4. Procedure NsOrbit ( StartCol   , StartRow,
  5.                     EndCol     , EndRow,
  6.                     Style      , NumberOfSeconds : Integer);
  7. Var
  8.    NumberCols, NumberRows, I,
  9.    RowDelay, ColDelay : Integer;
  10. begin
  11.  
  12.    RowDelay := 3;
  13.    ColDelay := 1;
  14.    NumberCols := EndCol - StartCol + 1;
  15.    NumberRows := EndRow - StartRow + 1;
  16.  
  17.    BoxUL (StartCol, StartRow, EndCol, EndRow, Style, 14);
  18.  
  19.    repeat
  20.       for i := 0 to NumberCols - 1  do
  21.       begin
  22.          SetAtt ( StartCol+i, StartRow, StartCol+i, StartRow, 14);
  23.          delay(ColDelay);
  24.          SetAtt ( StartCol+i, StartRow, StartCol+i, StartRow,  0);
  25.          delay(ColDelay);
  26.          SetAtt ( EndCol-i, EndRow, EndCol-i, EndRow,  14);
  27.          delay(ColDelay);
  28.          SetAtt ( EndCol-i, EndRow, EndCol-i, EndRow,  0);
  29.          delay(ColDelay);
  30.       end;
  31.  
  32.       for i := 0 to NumberRows - 1  do
  33.       begin
  34.          SetAtt ( EndCol, StartRow+i, EndCol, StartRow+i, 14);
  35.          delay(RowDelay);
  36.          SetAtt ( EndCol, StartRow+i, EndCol, StartRow+i,  0);
  37.          delay(RowDelay);
  38.          SetAtt ( StartCol, EndRow-i, StartCol, EndRow-i, 14);
  39.          delay(RowDelay);
  40.          SetAtt ( StartCol, EndRow-i, StartCol, EndRow-i,  0);
  41.          delay(RowDelay);
  42.       end;
  43.  
  44.       for i := 0 to NumberCols - 1  do
  45.       begin
  46.          SetAtt ( StartCol+i, StartRow, StartCol+i, StartRow, 14);
  47.          delay(ColDelay);
  48.          SetAtt ( StartCol+i, StartRow, StartCol+i, StartRow,  0);
  49.          delay(ColDelay);
  50.          SetAtt ( EndCol-i, EndRow, EndCol-i, EndRow, 14);
  51.          delay(ColDelay);
  52.          SetAtt ( EndCol-i, EndRow, EndCol-i, EndRow,  0);
  53.          delay(ColDelay);
  54.       end;
  55.  
  56.       for i := 0 to NumberRows - 1  do
  57.       begin
  58.          SetAtt ( StartCol, EndRow-i, StartCol, EndRow-i, 14);
  59.          delay(RowDelay);
  60.          SetAtt ( StartCol, EndRow-i, StartCol, EndRow-i,  0);
  61.          delay(RowDelay);
  62.          SetAtt ( EndCol, StartRow+i, EndCol, StartRow+i, 14);
  63.          delay(RowDelay);
  64.          SetAtt ( EndCol, StartRow+i, EndCol, StartRow+i,  0);
  65.          delay(RowDelay);
  66.       end;
  67.    until Timer(NumberOfSeconds) or KeyPressed;
  68.    if KeyPressed then
  69.    begin
  70.       read(Kbd,ch);
  71.       StartElapsed := FALSE;
  72.    end;
  73.    BoxUL (StartCol, StartRow, EndCol, EndRow, Style, 14);
  74. end { NsOrbit };